@extends('app')
@section('css')
    @parent
    <link href="{{ asset('web/css/admin.css') }}" rel="stylesheet">
@stop
@section('content')
    <div class="page">
        <div class="header">“水榭香堤” 管理系统</div>
        <div class="row">
            <div class="col-md-12">
                @include('admin.left')
                <div class="col-md-10">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <a href="{{ url('admin/votes/') }}" class="btn btn-default btn-sm">待审核</a>
                            <a href="{{ url('admin/votes/1/list') }}" class="btn btn-default btn-sm">已通过</a>
                            <a href="{{ url('admin/votes/2/list') }}" class="btn btn-default btn-sm">已拒绝</a>
                        </div>
                        <div class="panel-body">
                            @include('_errors')
                            @foreach($votes as $vote)
                                <div class="col-sm-6 col-md-3 vote{{ $vote->id }}">
                                    <div class="thumbnail">
                                        <a href="{{ route('admin.votes.edit', [$vote->id]) }}"><img
                                                    src="{{ asset($vote->img_src) }}" alt="{{ $vote->title }}"></a>
                                        <div class="caption">
                                            <h3 class="text-center">{{ $vote->title }}({{ $vote->vote_count }})</h3>
                                            <h3 class="text-center">联系方式：{{ $vote->content }}</h3>
                                            <p class="text-center">
                                                @if($vote->is_lock != 1)
                                                    <a href="{{ url('admin/votes/passed/'.$vote->id) }}"
                                                       data-method="POST" class="btn btn-default btn-sm">通过</a>
                                                @endif
                                                @if($vote->is_lock != 2)
                                                    <a href="{{ url('admin/votes/locked/'.$vote->id) }}"
                                                       data-method="POST" class="btn btn-default btn-sm">拒绝</a>
                                                @endif
                                                <a href="{{ route('admin.votes.destroy', [$vote->id]) }}"
                                                   data-method="DELETE" data-confirm="您确定删除吗?" class="btn btn-default btn-sm">删除</a>
                                            </p>
                                        </div>
                                    </div>
                                </div>
                            @endforeach
                            <div class="pull-right">
                                {!! $votes->render() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@stop